package edu.ensmp.ckEditor.control;


import java.awt.event.ActionEvent;

import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import edu.ensmp.ckEditor.main.Launcher;

public class TabListener implements ChangeListener {

	public void stateChanged(ChangeEvent e) {
		JTabbedPane pane = (JTabbedPane) e.getSource();
		int index = pane.getSelectedIndex();
		
		switch (index) {
		case 0:
			Launcher.getConceptGraphMouse().setEditingMode();
			Launcher.getKnowledgeGraphMouse().setEditingMode();
			break;
			
		case 1:
			Launcher.getConceptGraphMouse().setPickingMode();
			Launcher.getKnowledgeGraphMouse().setPickingMode();
			break;
			
		case 2:
			Launcher.getConceptGraphMouse().setTransformingMode();
			Launcher.getKnowledgeGraphMouse().setTransformingMode();
			break;
			
		default:
			Launcher.getConceptGraphMouse().setTransformingMode();
			Launcher.getKnowledgeGraphMouse().setTransformingMode();
			break;
		}
		
	}

}
